#pragma GCC optimize("Ofast", "unroll-loops")
#include<bits/stdc++.h>
using namespace std; using ll = long long;
#define For(i, j, k) for ( int i = (j) ; i <= (k) ; i++ )
#define Fol(i, j, k) for ( int i = (j) ; i >= (k) ; i-- )
constexpr int inf = numeric_limits < int >::max() >> 1;
string s, dir; char cs[3], a[30][30], bstd; int x, y, xx, yy, mn, sx, sy; bool ok;
inline void chk(int x, int y, int i, char d)
{
	if ( a[x][y] != s[i] ) return;
	if ( !( x % 3 ) && !( y % 3 ) && i != (int)s.size() - 1 && s[i] != s[i + 1] ) return;
	int dis = ( x - 15 ) * ( x - 15 ) + ( y - 15 ) * ( y - 15 );
	if ( dis < mn ) mn = dis, xx = x, yy = y, bstd = d;
}
int main()
{
	freopen("snake.in", "r", stdin), freopen("snake.out", "w", stdout);
	cin.tie(nullptr) -> sync_with_stdio(false);
	cin >> s, cs[0] = 'B', cs[1] = 'G', cs[2] = 'R';
	do
	{
		For(i, 0, 29)
			if ( !( i % 3 ) ) fill(a[i], a[i] + 30, cs[0]);
			else if ( i % 6 < 3 ) For(j, 0, 29) a[i][j] = cs[j % 3];
			else For(j, 0, 29) a[i][j] = cs[( 30 - j ) % 3];
		mn = inf, ok = true, dir.clear();
		For(i, 0, 29) For(j, 0, 29) chk(i, j, 0, 0);
		if ( mn == inf ) continue; else sx = xx, sy = yy;
		For(i, 1, (int)s.size() - 1)
		{
			x = xx, y = yy, mn = inf;
			if ( x       ) chk(x - 1, y, i, 'U');
			if ( x != 29 ) chk(x + 1, y, i, 'D');
			if ( y       ) chk(x, y - 1, i, 'L');
			if ( y != 29 ) chk(x, y + 1, i, 'R');
			if ( mn == inf ) { ok = false; break; } else dir += bstd;
		}
		if ( ok )
		{
			cout << "30 30\n"; For(i, 0, 29) { For(j, 0, 29) cout << a[i][j]; cout << '\n'; }
			return cout << sx + 1 << ' ' << sy + 1 << '\n' << dir << '\n', 0;
		}
	}
	while ( next_permutation(cs, cs + 3) );
	return assert(false), 0;
}